package com.meituan.sdk.model.ddzhkh.shangpin.productProductUpdateProductStock;

import com.meituan.sdk.annotations.ApiMeta;
import java.util.List;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import com.meituan.sdk.internal.utils.JsonUtil;
import com.google.gson.annotations.SerializedName;
import javax.validation.constraints.NotNull;
import com.meituan.sdk.MeituanResponse;
import com.meituan.sdk.MeituanRequest;
import javax.validation.constraints.NotEmpty;

/**
* 更新商品库存
* This file was automatically generated.
*/
@ApiMeta(
    path = "/ddzhkh/shangpin/product/updateproductstock",
    businessId = 59,
    apiVersion = "10010",
    apiName = "product_product_update_product_stock",
    needAuth = true
)
public class ProductProductUpdateProductStockRequest implements MeituanRequest<ProductProductUpdateProductStockResponse> {
    /**
    * <p data-diff-id="ct-diff-id-eecdb99a-0dfe-4bad-b08f-3422620beefd">美团商品ID</p>
    */
    @NotNull(message = "productId不能为空")
    @SerializedName("productId")
    private Long productId;
    /**
    * <p data-diff-id="ct-diff-id-af487841-a5b1-47ae-a644-c1b7cc057b9b"><span style="color: rgb(31, 45, 61)">售卖SKU 注：类型为对象类型，详见扩展参数item_stocks &nbsp; &nbsp;</span></p>
    */
    @NotEmpty(message = "itemStocks不能为空")
    @SerializedName("itemStocks")
    private List<ItemStock> itemStocks;

    public Long getProductId() {
        return productId;
    }
    public void setProductId(Long productId) {
        this.productId = productId;
    }
    public List<ItemStock> getItemStocks() {
        return itemStocks;
    }
    public void setItemStocks(List<ItemStock> itemStocks) {
        this.itemStocks = itemStocks;
    }


    @Override
    public MeituanResponse<ProductProductUpdateProductStockResponse> deserializeResponse(String response) {
        Type type = new TypeToken<MeituanResponse<ProductProductUpdateProductStockResponse>>(){}.getType();
        return JsonUtil.fromJson(response, type);
    }
    @Override
    public String serializeToJson() {
        return JsonUtil.toJson(this);
    }


    @Override
    public String toString() {
        return "ProductProductUpdateProductStockRequest{" + "productId=" + productId + "," + "itemStocks=" + itemStocks + "}";
    }
}
